package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.dto.LoginUser;
import net.wanho.service.AuthService;
import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author：汤小洋
 * Date：2024-01-30 15:59
 * Description：<描述>
 */
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
public class AuthController {

    private final AuthService authService;

    @PostMapping("/login")
    public AjaxResult login(@RequestBody LoginUser loginUser){
        String token = authService.login(loginUser);
        return AjaxResult.success(token);
    }

}
